<template>
	<view class="building-info">
		<view class="building-head">
			<view class="head-1">
				<view class="head-1-img">
					<image v-if="info.images=='' || info.images==null" src="../../../static/infor/buildings.jpeg"></image>
					<image v-else :src="info.images"></image>
				</view>
				<view class="head-1-text">
					<view class="text1"><text>{{info.fullName}}</text></view>
					<view class="text1"><text>{{info.gridName}}</text></view>
				</view>
			</view>
			<view class="head-2">
				<view class="head-2-1">简介：{{ info.synopsis || '暂无资料'}}</view>
				<view class="head-2-2">
					<view class="head-2-item">
						<view class="item-top">{{ info.familyNum }}户</view>
						<view class="item-bottom">户籍总数</view>
					</view>
					<view class="head-2-item">
						<view class="item-top">{{ info.houseNum }}</view>
						<view class="item-bottom">房屋总数</view>
					</view>
					<view class="head-2-item">
						<view class="item-top">{{ info.stayNum }}</view>
						<view class="item-bottom">居住总数</view>
					</view>
				</view>
			</view>
		</view>
		<view class="info-basic">
			<view class="basic-head">基本信息</view>
			<view class="bsic-content">
				<view class="basic-item">
					<view class="item-left">楼栋类型</view>
					<view class="item-right">{{info.type}}</view>
				</view>
				<view class="basic-item">
					<view class="item-left">楼层</view>
					<view class="item-right">{{info.floorNum}}层</view>
				</view>
				<view class="basic-item">
					<view class="item-left">单元数</view>
					<view class="item-right">{{info.unitNum}}个</view>
				</view>
				<view class="basic-item">
					<view class="item-left">负责人</view>
					<view class="item-right">{{info.resName || '暂无资料'}}</view>
				</view>
				<view class="basic-item">
					<view class="item-left">负责人电话</view>
					<view class="item-right">{{info.resPhone || '暂无资料'}}</view>
				</view>
				<view class="basic-item">
					<view class="item-left">地址</view>
					<view class="item-right">{{info.address || '暂无资料'}}</view>
				</view>
			</view>
		</view>
	<!-- 	<view class="info-basic">
			<view class="basic-head">单元信息</view>
			<view class="basic-con">
				<view class="con-item" @click="handleGoHouseList">
					<view class="item-left">1单元</view>
					<view class="item-right">44户</view>
				</view>
			</view>
		</view> -->
	</view>
</template>

<script>
	export default{
		data() {
			return{
				info:{}
			}
		},
		onLoad() {
			// 接到缓存中 上一个页面传过来的值
			this.info = JSON.parse(uni.getStorageSync("info"))
			console.log(this.info)
			uni.setNavigationBarTitle({
				title:this.info.fullName
			})
		},
		onNavigationBarButtonTap() {
			uni.navigateTo({
				url:'../bulding-edit/bulding-edit?id='+this.info.id
			})
		},
		methods:{
			// 房屋列表
			handleGoHouseList() {
				uni.navigateTo({
					url:'../House/House'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.building-info{
		background-color: #f5f6f7;
		min-height: 100vh;
		padding: 20rpx;
		.building-head{
			width: 100%;
			background-color: #fff;
			border-radius: 10rpx;
			box-shadow: 3px 3px 3px #eee;
			padding: 20rpx;
			.head-1{
				display: flex;
				justify-content: flex-start;
				align-items: center;
				height: 160rpx;
				width: 100%;
				.head-1-img{
					width: 160rpx;
					height: 160rpx;
					margin-right: 20rpx;
				}
				.head-1-text{
					display: flex;
					justify-content: space-between;
					flex-direction: column;
					align-items: flex-start;
					font-size: 28rpx;
					height: 160rpx;
					.text1{
						color: #999;
						text{
							display: inline-block;
							color: #333;
						}
					}
				}
			}
			.head-2{
				margin: 20rpx 0;
				.head-2-1{
					color: #999;
					font-size: 24rpx;
					padding: 20rpx 0;
				}
				.head-2-2{
					display: flex;
					justify-content: space-around;
					align-items: center;
					padding: 20rpx;
					background-color: #fdf9e6;
					border-radius: 10rpx;
					.head-2-item{
						display: flex;
						align-items: center;
						flex-direction: column;
						justify-content: center;
						.item-top{
							color: #F0AD4E;
							font-weight: 600;
							font-size: 35rpx;
							margin-bottom: 10rpx;
						}
						.item-bottom{
							color: #333;
							font-size: 28rpx;
						}
					}
				}
			}
		}
		.info-basic{
			width: 100%;
			border-radius: 10rpx;
			margin-top: 20rpx;
			box-shadow: 3p 3px 3px #eee;
			.basic-head{
				color: #000;
				font-size: 30rpx;
				font-weight: 600;
				background-image: linear-gradient(to right,#e6eefd,#fdfdfd);
				padding: 20rpx;
			}
			.bsic-content{
				background-color: #fff;
				
				.basic-item{
					display: flex;
					justify-content: flex-start;
					align-items: center;
					font-size: 28rpx;
					padding: 20rpx;
					.item-left{
						color: #999;
						width: 25%;
					}
					.item-right{
						color: #333;
						width: 75%;
						padding-left: 20rpx;
					}
				}
			}
			.basic-con{
				background-color: #fff;
				padding: 20rpx;
				.con-item{
					display: flex;
					justify-content: space-between;
					align-items: center;
					padding: 20rpx;
					background-color: #eceefc;
					border-radius: 10rpx;
					margin-bottom: 10rpx;
					.item-left{
						color: #333;
						font-size: 28rpx;
					}
					.item-right{
						color: #3F536E;
						font-size: 25rpx;
					}
				}
			}
		}
	}
</style>
